<!--
 * @Author: jay
 * @Date: 2021-08-17 21:40:21
 * @LastEditTime: 2021-08-17 22:10:24
 * @LastEditors: Please set LastEditors
 * @Description: 盒子
 * @FilePath: \Briup\Common\study\2-css\3-其他样式规则\box.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>盒子模型</title>
    <style>
        html{
            font: 12px/1 '宋体';
        }
        body{
            margin: 0;
        }
        .box{
            box-sizing: border-box;
            width: 100px;
            height: 100px;
            background-color: pink;

            /* margin: 10px; 上右下左        */
            /* margin: 10px 20px 30px 40px; */
            /* margin: 10px 20px; */            
            margin: 10px 20px 30px;   

            padding-top: 10px;
            padding-left: 10px;
            padding-right: 10px;                /*用法同margin */

           /*  border-width: 2px;
               border-color: rebeccapurple;
               border-style: solid; */
            border: 2px rebeccapurple dashed;
        }
    </style>
</head>
<body>
    <div class="box">盒子一般指的是块元素，盒子是我们布局的重要机制。一个盒子应该由外边距、边框、内边距、内容组成。</div>
    <div class="box">盒子2</div>
</body>
</html>